<% @main_header = "#{link_to('Ptrack:', '/')} #{@project.name if @project}: Tasks" %>
<div class="span-18">
  <%  # Do not show  Create New Task link if @project is nil. This means no project is selected and task cannot be linked to it. %>
  <h3><%= link_to 'Create New Task', :action => 'new' if @project %></h3>
  <% # Do not show header if @project is nil  %>
  <h3><%= "Listing All Tasks Of This Project" if @project %></h3>
  <%#= tree_ul(@tasks) {|item| link_to image_tag("cancelled.png",
  :border =>0), :action  =>  'show',  :id => item } if @project %>
  <% #@task_status = @tasks.collect {|t| [t.status]} %>
  <%# Created by: Arda Basoglu. Last edited: 2009-04-03 %>

<% for activity in @project.activities %>
<br />
<h4><u><%=activity.phase.name%></u></h4>

  <% activity.tasks.each do |item|%>
    
    <%= '<img title="' + item.status.to_s + '" src="/images/' +
      item.status.to_s.downcase.tr(' ', '') + '.png" alt="'  + item.status.to_s  + '" />' %>
    <%= link_to item.name, { :action => "show", :id => item} %><br />
  <% end %>
<%end%>
</div>